//
// C:\Program Files (x86)\FlashDevelop\Tools\flexsdk\frameworks\libs\player\10.0\playerglobal.swc\flash\display\Stage
//
package flash.display
{
	import flash.display.DisplayObject;
	import flash.geom.Rectangle;
	import flash.text.TextSnapshot;
	import flash.display.InteractiveObject;
	import flash.accessibility.AccessibilityImplementation;
	import flash.accessibility.AccessibilityProperties;
	import flash.events.Event;
	import flash.ui.ContextMenu;
	import flash.geom.Transform;
	import flash.utils.setInterval;
	import js.element.canvas.CanvasRenderingContext2D;
	import js.element.HTMLCanvasElement;

	public class Stage extends DisplayObjectContainer
	{
		static private var _ctx:CanvasRenderingContext2D;
		
		private var _canvas:HTMLCanvasElement;
		private var _fps:int;
		
		
		public function Stage (canvas:HTMLCanvasElement,fps:int=15)
		{
			_fps = fps;
			_canvas = canvas;
			_ctx = _canvas.getContext("2d");
			setInterval(onRenderFrame, 1000 / _fps);
		}
		
		
		private function onRenderFrame()
		{
			_ctx.clearRect(0, 0, stageWidth, stageHeight);
			render(_ctx);
		}
		
		
		public function set accessibilityImplementation (value:AccessibilityImplementation) : void;

		public function set accessibilityProperties (value:AccessibilityProperties) : void;

		
		public function get align () : String;
		public function set align (value:String) : void;

		public function get colorCorrection () : String;
		public function set colorCorrection (value:String) : void;

		
		public function get colorCorrectionSupport () : String;

		public function set contextMenu (value:ContextMenu) : void;

		public function get displayState () : String;
		public function set displayState (value:String) : void;

		public function get focus () : flash.display.InteractiveObject;
		public function set focus (newFocus:InteractiveObject) : void;

		public function set focusRect (value:Object) : void;

		
		public function get frameRate () : Number;
		public function set frameRate (value:Number) : void;

		
		public function get fullScreenHeight () : uint;

		public function get fullScreenSourceRect () : flash.geom.Rectangle;
		public function set fullScreenSourceRect (value:Rectangle) : void;

		
		public function get fullScreenWidth () : uint;

		public function get quality () : String;
		public function set quality (value:String) : void;

		public function set scale9Grid (value:Rectangle) : void;

		
		public function get scaleMode () : String;
		public function set scaleMode (value:String) : void;

		public function set scrollRect (value:Rectangle) : void;

		
		public function get showDefaultContextMenu () : Boolean;
		public function set showDefaultContextMenu (value:Boolean) : void;

		
		public function get stageFocusRect () : Boolean;
		public function set stageFocusRect (on:Boolean) : void;

		
		public function get stageHeight () : int
		{
			return int(_canvas.height);
		}
		public function set stageHeight (value:int) : void
		{
			_canvas.height = value;
		}

		
		public function get stageWidth () : int
		{
			return int(_canvas.width);
		}
		public function set stageWidth (value:int) : void {
			_canvas.width = value;
		}

		public function get tabChildren () : Boolean;
		public function set tabChildren (value:Boolean) : void;

		public function set tabEnabled (value:Boolean) : void;

		public function set tabIndex (value:int) : void;

		
		public function get textSnapshot () : flash.text.TextSnapshot;

		public function set transform (value:Transform) : void;

		public function set visible (value:Boolean) : void
		{
			if (!value)
				_canvas.style.display = "none";
			else
				_canvas.style.display = "block";
		}
		
		public function get visible():Boolean
		{
			return _canvas.style.display=="block";
		}
		
		public function get wmodeGPU () : Boolean
		{
			return false
		}		
		static public function get ctx():CanvasRenderingContext2D 
		{
			return _ctx;
		}

		public function invalidate () : void;

		public function isFocusInaccessible () : Boolean;

	}
}
